home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
401-425
/
disk_416
/
quantizer
/
flclq.doc
< prev
next >
Wrap
Text File
|
1992-05-06
|
7KB
|
202 lines
*******************************************************************************
FLCLQ Color Quantizer for the AMIGA v1.0
*******************************************************************************
Copyright 1990, Christophe LABOUISSE & Frederic LOUGUET
ALL RIGHTS RESERVED
Distribution:
This program is available to the public as SHAREWARE, therefore, its
distribution is encouraged, provided no profit is made, excluding
nominal costs for copying and handling.
Usage Rights:
Anyone is free to use this program for a period of time, not to exceed
30 days, for the purpose of evaluation. After such a time, usage rights
are revoked pending registration and a small fee of a few dollars to the
authors.
Well, it's up to you. Give us some money to write the next version, between
20 $ and 1.000.000.000.000.000.000.000.000.000.000.000.000.000 $ !
Write to us, send us images, give us informations on other shareware, public
domain or commercial products which do the same job better (if any).
If we become VERY RICH (ah!ah!), we will write a VERY optimized version.
We already know how to do that with Octree Quantization. If we don't become
very rich, we will MAYBE write this optimized version.
Thank you for your support.
Addresses: Christophe LABOUISSE Frederic LOUGUET
67 rue de Wissous 2 rue des Amandiers, Les Tilleuls
91320 Wissous 91800 Boussy St Antoine
FRANCE FRANCE
********************************************************************************
FLCLQ is a Color Quantizer. It converts 24 bits true color images into
256 or less colors images. It uses a fairly sophisticated algorithm, mixing
Median-Cut, Popularity method and a "house-made" algorithm.
FLCLQ runs on any Amiga with 68x00 processor and use Motorola Fast Floating
Point routines.
FLCLQ020 runs on any accelerated Amiga with a 68020/881 or 68030/882
combination. A coprocessor is REQUIRED, since FLCLQ020 uses inline floating
point instructions (-f8d Lattice parameter).
FLCLQ has been written with Lattice C 5.05.
We provide four sample images :
BALL32IL.lbm is a 320x200x32 colors image converted by the commercial pro-
duct ImageLink from Active Circuits. This is a great product,
but their Quantizer is not the best part of the program...
BALL32FL.lbm is the same image converted by FLCLQ. Isn't it better ?
These two images can be displayed on a standard Amiga.
The next two images are VGA 320x200x256 colors. They can be displayed on
any PC-XT/AT/386/486 with a VGA board.
BALLILDI is converted with ImageLink with Floyd-Steinberg dithering.
BALLFLDI is converted with FLCLQ with our own dithering.
As you can see, the difference is much more noticeable than with the 32
colors images. The original image was calculated with Sculpt-Animate 4D
in 320x200 pixels and RGB format.
The syntax of FLCLQ is described when you run the program without parameter.
It accepts as input 24 bits RGB files from Sculpt-Animate (Raw format, one
red file (.r or .red), one green file (.g or .grn) and one blue file
(.b or .blu)).
It outputs a file in IFF ILBM or RIX VGA PAINT format or simply converts
in one RGB file to display the image on the Hercules Graphics Station Card.
In this case, the image must be 512x480 pixels, calculated with a 13/10
ratio in SA-4D and displayed with the demo program shipped with the HGSC.
Other parameters :
-g : Outputs gray levels. It speaks for itself.
-d : Dithering. The conversion takes longer but is better if it is activated
-b : bitplanes for output. 8 means 256 colors, 6 64 colors, 5 32 colors, etc
-c : bits per RGB component. 4 means a 4096 colors palette or 12
bits per pixel = AMIGA), 6 means a 262144 colors palette or 18 bits
per pixel = VGA), and 8 means a 16777216 colors palette or 24 bits
per pixel = MAC II).
-p : Popularity significativity level. 15000 by default, it represents the
level at which some pixels are processed by a variation of the popularity
algorithm. It helps to give better results than with a simple Median-Cut.
-w : Image width. It is difficult to understand, isn't it ?
-h : Image height. It is even more difficult...
-O : Name of the converted image. It is TOO difficult to explain.
Now, here is two exemples :
1) You want to convert the 24 bits Sculpt-RGB image BALL which consists
of the three files BALL.RED, BALL.GRN and BALL.BLU in a 32 colors IFF
image displayable on the Amiga, with no dithering. Here is the syntax :
FLCLQ -eS -si -b5 -c4 -w320 -h200 -O <VOL>:BALL32FL.lbm <VOL>:BALL
-eS for .red, .grn, .blu extensions
-si for iff output
-b5 for 32 colors
-c4 for 4096 colors palette (16 levels of RGB)
-w320, -h200 for the resolution
-O <name of the final image>
and then the name of RGB files ("BALL").
Then you get the BALL32FL.lbm exemple. The extension ".lbm" is not required.
Now you want to convert it into a 256 colors VGA, with dithering :
FLCLQ -eS -si -b8 -c6 -w320 -h200 -O <VOL>:BALLFLDI.lbm <VOL>:BALL
-b8 for 256 colors
-c6 for 262144 colors VGA palette (64 levels of RGB)
The extension ".lbm" is useful here, because you can directly load the image
into DeLuxe Paint II Enhanced PC to modify it if you want to.
--------------------------------------------------------------------------
FLCLQ uses B-trees and dynamic memory allocation. It is not very fast,
especially when the resolution and the size of the palette is getting
big. It has been tested up to 1024x768 resolution.
Here are some benchmarks :
BALL Conversion FLCLQ 68000 FLCLQ/020
--------------- Amiga 2000 - 3 Mo GVP 68030/882-28 Mhz
To 32 colors 1 minute 33 seconds 11.4 seconds
Palette 4096
No dithering
To 256 colors
Palette 262144 21 minutes 03 seconds 2 minutes 18 seconds
Dithering
As you can see, you can expect a 8 to 9 times acceleration with a 68030
over a standard Amiga.
---------------------------------------------------------------------------
We already know how to optimize all this. OCTREE QUANTIZATION is the key.
It would be MUCH faster than the current version and would knocks the doors
off the competition. (hugh, well said). The Read/Write routines need to be
optimized, too.
However, it requires a lot of work. We will do this work if you ask us to,
and if you give us just a little time and money to.
Here again are our addresses. Long live the Amiga AND the big PCs.
AND REMEMBER : FLCLQ will give its best results when converting 24 bits RGB
to 256 colors VGA images.
Christophe LABOUISSE Frederic LOUGUET
67 rue de Wissous 2 rue des Amandiers, Les Tilleuls
91320 Wissous 91800 Boussy St Antoine
FRANCE FRANCE